package deom1;

import java.util.Scanner;

public class Main{

 static int[] sum ={0,31,28,31,30,31,30,31,31,30,31,30,31};
  	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String date = scan.nextLine(); String dateTwo = "2018/10/1" ;
		int[] date1 = zb(date) ;
		int[] date2 =zb(dateTwo) ;
		int sum = num(date1[0] ,date1[1] , date1[2])-num(date2[0],date2[1],date2[2]) ;
		if(sum>0){
			System.out.println(sum);
		}else {
			System.out.println(-sum);
		}
  }
   public static int[] zb(String str){
		 String[] nums = str.split("/",3) ;
		 int[] arr = new int[3] ;
		 arr[0] = Integer.parseInt(nums[0]);
		 arr[1] = Integer.parseInt(nums[1]);
		 arr[2] = Integer.parseInt(nums[2]);
          return arr ;
	 }
    public static int num(int year , int month , int day){
		  int dayC1 = day - 1 ;
		  for(int i = month ; i>1 ; i--){
			  dayC1 += sum[i - 1] ;
		  }
		  if(((year%4==0&&year%100!=0)||year%400==0)&&month>2){
			  dayC1++ ;
		  }
		  dayC1+= (year-1)*365 + (year-1)/4 -(year-1)/100+(year-1)/400 ;
		   return dayC1 ;
	}


}